const TOKEN_NAME = 'ydd-token'

// 存取用户 token
export const setStorageToken = (payload) => {
  localStorage.setItem(TOKEN_NAME, JSON.stringify(payload))
}

export const getStorageToken = () =>
  JSON.parse(localStorage.getItem(TOKEN_NAME)) || ''

export const removeStorageToken = () => {
  localStorage.removeItem(TOKEN_NAME)
}

export const setStorageAercle = (payload) => {
  localStorage.setItem('ydd-artcle', JSON.stringify(payload))
}

export const getStorageAercle = () =>
  JSON.parse(localStorage.getItem('ydd-artcle')) || {}
